package com.qf.qfleadnewsfeignapi.schedule;

import com.qf.qfleadnewsmodel.commons.dtos.ResponseResult;
import com.qf.qfleadnewsmodel.schedule.dtos.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "qf-schedule")
public interface ScheduleApi {

    /**
     * 调度任务添加
     */
    @PostMapping("/api/shedule/addTask")
    ResponseResult addTask(@RequestBody Task task);


    /**
     * 调度任务消费
     */
    @GetMapping("/api/shedule/one/{type}/{priority}")
    ResponseResult consumeTask(@PathVariable("type")int type,@PathVariable("priority")int priority);
}
